class RecentClosingPrice {
  final String date;
  final String code;
  final double close;

  RecentClosingPrice({
    required this.date,
    required this.code,
    required this.close,
  });

  factory RecentClosingPrice.fromJson(Map<String, dynamic> json) {
    return RecentClosingPrice(
      date: json['date'] ?? '',
      code: json['code'] ?? '',
      close: double.tryParse(json['close']?.toString() ?? '0') ?? 0,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'date': date,
      'code': code,
      'close': close,
    };
  }
}